package gossip.v2.core;

import java.util.Map;
import java.util.concurrent.ConcurrentHashMap;

public class TopologyManager {
    private final Map<String, Long> latencyMetrics = new ConcurrentHashMap<>();

    public long getNodeLatency(String nodeId) {
        return latencyMetrics.getOrDefault(nodeId, Long.MAX_VALUE);
    }

    public void recordLatency(String nodeId, long nanos) {
        latencyMetrics.put(nodeId, nanos / 1_000_000);
    }
}
